#include "VisitorCheckArm.h"
#include "Point.h"
#include "screen.h"
#include "Arm.h"
#include "AlarmZone.h"

void VisitorCheckArm::WhatToDo(Arm * a)
{
Point A,C;
A = a->getLinkFirst().getStart();
C = a->getLinkSecond().getEnd();
int ax = (int)A.getX();
int cx = (int)C.getX();
int cy = (int)C.getY();

	if (ax+cx >= AlarmZone::AlarmZoneGet()->x1   && 
		ax+cx <= AlarmZone::AlarmZoneGet()->x2   && 
		YOFF-cy >= AlarmZone::AlarmZoneGet()->y1 &&
		YOFF-cy <= AlarmZone::AlarmZoneGet()->y2)
 			AlarmZone::AlarmZoneGet()->Add(a);
	else
			AlarmZone::AlarmZoneGet()->Remove(a);

}
